package com.cloudOffice.enumeration;

import com.cloudOffice.constant.HttpConstant;
import lombok.Getter;

/**
 * @program: cloud-office
 * @className: ResultCodeEnum
 * @description: 统一返回结果状态信息类
 * @data: 2024/2/4 15:56
 * @author: ihu
 * @version: 1.0
 **/
@Getter
public enum ResultCodeEnum {
	
	SUCCESS(HttpConstant.CODE_200, "成功"),
	FAIL(HttpConstant.CODE_201, "失败"),
	SERVICE_ERROR(HttpConstant.CODE_2012, "服务异常"),
	DATA_ERROR(HttpConstant.CODE_204, "数据异常"),
	LOGIN_ERROR(HttpConstant.CODE_208, "认证失败"),
	TOKEN_INVALID(HttpConstant.CODE_401, "令牌已失效"),
	REMOTE_LOGIN(HttpConstant.CODE_401, "账号已在其他设备登录，请重新登录"),
	LOGIN_AUTH(HttpConstant.CODE_208, "未登陆"),
	PERMISSION(HttpConstant.CODE_401, "没有权限");
	
	private final Integer code;
	
	private final String message;
	
	ResultCodeEnum(Integer code, String message) {
		this.code = code;
		this.message = message;
	}
}